/*
 * seft_struct.h
 *
 *  Created on: 2012-4-23
 *      Author: iot
 */

#ifndef _SEFT_STRUCT_H_
#define _SEFT_STRUCT_H_

#include "seft_include.h"
#include "trimps_plate.h"
//#include <opencv/cv.h>
/*****************************************************************************
**  Structure define by LHS
*****************************************************************************/
/*
typedef struct _CvRect
{
	int x;
	int y;
	int width;
	int height;
} CvRect;

*/
typedef struct _CvScalar
{
	double val[4];
} CvScalar;

/*****************************************************************************
**  Structure define
*****************************************************************************/
typedef struct _json_msg
{
	uint32_t    warningType;
	uint8_t	eventID[128];
	uint8_t	shortedTime[128];
	uint8_t	terminalID[128];
	uint8_t	relativePath[128]; 	 // add in sem_writer.

	uint8_t     plateNumber[21];
	uint32_t	plateNumberStructure;
	uint32_t    plateNumberColor;
	uint32_t	logo;
	uint32_t    color;
	uint32_t    size;
	uint32_t    type;
	uint32_t    speed;
	uint32_t    direction;
	uint8_t     vehiclePicName[128];
	uint8_t	colorLayout[256*1024];
	uint8_t	colorStructure[256*1024];
	uint8_t	edgeHistogram[256*1024];
	uint8_t	dominantColor[256*1024];
	uint8_t	scalableColor[256*1024];

	uint8_t	panoramaName[128];
	uint32_t    roadDirection;
	uint32_t    roadWay;
	uint32_t    target;
	uint32_t    targetAction;
	uint32_t    targetColor;
	uint32_t    targetSpeed;
	uint8_t	eventColorLayout[256*1024];
	uint8_t	eventColorStructure[256*1024];
	uint8_t	eventEdgeHistogram[256*1024];
	uint8_t	eventDominantColor[256*1024];
	uint8_t	eventScalableColor[256*1024];

	// add new data members for figure index creation.

    CvRect 		roi_plate; 		// 车牌在截图中的ROI区域坐标
    CvScalar 	color_rgb;  	// 主颜色值(BGR) and alpha.
    CvRect 		color_area; 	// 在截图中所参考的颜色区域

    uint32_t    has_sun_shield;
    uint32_t    has_seat_belt;
    double 	plate_rotation_angle;
} json_msg, *p_json_msg;

typedef struct _seft_plate_encode_t
{
	uint8_t		plate_pathname[128];
	uint8_t		scene_pathname[128];
	uint32_t	plate_upload_pend;
	uint32_t	scene_upload_pend;
	uint8_t		ttl_pathname[128];
	time_t		time;
	json_msg    msg;
}seft_plate_encode_t, *p_seft_plate_encode_t;
/*
typedef struct _seft_ftp_cd_t
{
	string path_year;
	string path_month;
	string path_day;
	string path_hour;
	string path_minute;
	string ftp_curr_dir;
	string ttl_name;
}seft_ftp_cd_t;
*/
typedef struct _seft_ftp_cd_t
{
	char path_year[5];
	char path_month[5];
	char path_day[5];
	char path_hour[5];
	char path_minute[5];
	char ftp_curr_dir[129];
	char ttl_name[10];
}seft_ftp_cd_t;
typedef struct _seft_plate_write_t
{
	uint8_t			plate_pathname[128];
	uint8_t			scene_pathname[128];
	uint32_t		plate_upload_pend;
	uint32_t		scene_upload_pend;
	uint8_t			ttl_pathname[128];
	time_t			time;
	uint32_t		ttl_upload_pend;
	seft_ftp_cd_t 	ftp_ctx;
	uint8_t		message[1500];//preliminary estimated for the result.modifed by LHS
}seft_plate_write_t, *p_seft_plate_write_t;

enum
{
	seft_image_not_exist,
	seft_image_exist,
	seft_image_upload_success
};


#endif /* _SEFT_STRUCT_H_ */

